package huawei;
/*
* @Author: wanghongfucoder
* @Date:   2017-06-28 17:48:30
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-06-28 17:48:51
*/

import java.util.Scanner;

public class Juzhanshe {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();//矩阵行数
            System.out.print(getResult(n));
        }
        scanner.close();
    }
    private static String getResult(int n){
        StringBuilder builder = new StringBuilder();
        for(int i=1;i<=n;i++){
            //j为每行元素个数，start为每行第一个数，step为间隔
            for(int j=1,start=(i-1)*i/2+1,step=i+1;j<=n-i+1;j++,start+=step,step++){
                builder.append(start).append(' ');    
            }
            //设置换行符
            builder.setCharAt(builder.length()-1,'\n');          
        }
        return builder.toString();
    }
}

